package com.sunrise.xdoc.entity.operator;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.sunrise.xdoc.entity.AbstractAuditEntity;

@Entity
@Table(name = "op_operator_role")
@Inheritance(strategy = InheritanceType.JOINED)
public class OperatorRole extends AbstractAuditEntity {
	private static final long serialVersionUID = -2449671169233468470L;
	private Operator operator;
	private OperatorProfile profile;
	private Date startDate;
	private Date endDate;

	@ManyToOne
	@JoinColumn(name = "operator_id")
	@NotNull
	public Operator getOperator() {
		return operator;
	}

	public void setOperator(Operator operator) {
		this.operator = operator;
	}

	@ManyToOne
	@JoinColumn(name = "profile_id")
	@NotNull
	public OperatorProfile getProfile() {
		return profile;
	}

	public void setProfile(OperatorProfile profile) {
		this.profile = profile;
	}

	@Column(name = "start_date")
	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Column(name = "end_date")
	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}
